GBML manual / Motion

friction

How much `speed` shrinks toward 0 every frame.

Syntax

friction: real

Description

How much speed shrinks toward 0 every frame - a flat per-frame reduction, not a percentage, so a small friction value drains a fast-moving instance and a slow one at the same steady rate.

Only ever touches speed, not hsp/vsp directly - an instance driven purely through hsp/vsp (never setting speed itself) will not feel any friction at all from this field.

Example

speed = 6;
direction = 45;
friction = 0.08;

A puck shoved diagonally that gradually coasts to a stop as friction bleeds speed down by 0.08 every frame.